Skip to content

Fix executorch -Wno-missing-prototypes flag for Zephyr/GCC builds (#19071)#19071

Open
karan1508 wants to merge 1 commit into
pytorch:mainfrom
karan1508:export-D100626340
Open

Fix executorch -Wno-missing-prototypes flag for Zephyr/GCC builds (#19071)#19071
karan1508 wants to merge 1 commit into
pytorch:mainfrom
karan1508:export-D100626340

Conversation

@karan1508
Copy link
Copy Markdown

@karan1508 karan1508 commented Apr 23, 2026

Summary:

The zephyr_build target for tsn_graph_simulator cannot be built using fbcode/mode/opt because executorch's build rules unconditionally pass -Wno-missing-prototypes to the compiler. This flag is only valid for C++ in Clang; GCC (used by Zephyr ARM cross-compilation) recognizes it as a C-only flag and rejects it for C++ files when -Werror is enabled.

The fix wraps -Wno-missing-prototypes in a select() that excludes it for Zephyr builds (ovr_config//os:zephyr), following the same pattern already used in executorch for Zephyr-specific handling (e.g., ATen header exclusion in elementwise_util and math_util).

Changes across executorch build files:

  • kernels/portable/op_registration_util.bzl: Added os:zephyr to existing OS select
  • kernels/optimized/op_registration_util.bzl: Wrapped flags in select
  • kernels/portable/cpu/util/targets.bzl: Wrapped 8 hardcoded flags in selects
  • kernels/portable/cpu/pattern/targets.bzl: Wrapped flag in select
  • kernels/aten/cpu/util/targets.bzl: Added os:zephyr to existing OS select
  • codegen/codegen.bzl: Wrapped flags in build_portable_lib and build_optimized_lib

Reviewed By: digantdesai

Differential Revision: D100626340

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot Bot commented Apr 23, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/19071

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

❌ 2 New Failures

As of commit 56c6a34 with merge base 803e47d (image):

NEW FAILURES - The following jobs have failed:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 23, 2026
@meta-codesync
Copy link
Copy Markdown
Contributor

meta-codesync Bot commented Apr 23, 2026

@karan1508 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D100626340.

Copy link
Copy Markdown
Contributor

@digantdesai digantdesai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@github-actions
Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@meta-codesync meta-codesync Bot changed the title Fix executorch -Wno-missing-prototypes flag for Zephyr/GCC builds Fix executorch -Wno-missing-prototypes flag for Zephyr/GCC builds (#19071) Apr 24, 2026
karan1508 added a commit to karan1508/executorch that referenced this pull request Apr 24, 2026
…torch#19071)

Summary:

The zephyr_build target for tsn_graph_simulator cannot be built using fbcode/mode/opt because executorch's build rules unconditionally pass `-Wno-missing-prototypes` to the compiler. This flag is only valid for C++ in Clang; GCC (used by Zephyr ARM cross-compilation) recognizes it as a C-only flag and rejects it for C++ files when `-Werror` is enabled.

The fix wraps `-Wno-missing-prototypes` in a `select()` that excludes it for Zephyr builds (`ovr_config//os:zephyr`), following the same pattern already used in executorch for Zephyr-specific handling (e.g., ATen header exclusion in `elementwise_util` and `math_util`).

Changes across executorch build files:
- `kernels/portable/op_registration_util.bzl`: Added `os:zephyr` to existing OS select
- `kernels/optimized/op_registration_util.bzl`: Wrapped flags in select
- `kernels/portable/cpu/util/targets.bzl`: Wrapped 8 hardcoded flags in selects
- `kernels/portable/cpu/pattern/targets.bzl`: Wrapped flag in select
- `kernels/aten/cpu/util/targets.bzl`: Added `os:zephyr` to existing OS select
- `codegen/codegen.bzl`: Wrapped flags in `build_portable_lib` and `build_optimized_lib`

Reviewed By: digantdesai

Differential Revision: D100626340
karan1508 added a commit to karan1508/executorch that referenced this pull request Apr 24, 2026
…torch#19071)

Summary:

The zephyr_build target for tsn_graph_simulator cannot be built using fbcode/mode/opt because executorch's build rules unconditionally pass `-Wno-missing-prototypes` to the compiler. This flag is only valid for C++ in Clang; GCC (used by Zephyr ARM cross-compilation) recognizes it as a C-only flag and rejects it for C++ files when `-Werror` is enabled.

The fix wraps `-Wno-missing-prototypes` in a `select()` that excludes it for Zephyr builds (`ovr_config//os:zephyr`), following the same pattern already used in executorch for Zephyr-specific handling (e.g., ATen header exclusion in `elementwise_util` and `math_util`).

Changes across executorch build files:
- `kernels/portable/op_registration_util.bzl`: Added `os:zephyr` to existing OS select
- `kernels/optimized/op_registration_util.bzl`: Wrapped flags in select
- `kernels/portable/cpu/util/targets.bzl`: Wrapped 8 hardcoded flags in selects
- `kernels/portable/cpu/pattern/targets.bzl`: Wrapped flag in select
- `kernels/aten/cpu/util/targets.bzl`: Added `os:zephyr` to existing OS select
- `codegen/codegen.bzl`: Wrapped flags in `build_portable_lib` and `build_optimized_lib`

Reviewed By: digantdesai

Differential Revision: D100626340
@karan1508 karan1508 force-pushed the export-D100626340 branch 2 times, most recently from 6d73fef to ea671db Compare April 28, 2026 08:59
karan1508 added a commit to karan1508/executorch that referenced this pull request Apr 28, 2026
…torch#19071)

Summary:

The zephyr_build target for tsn_graph_simulator cannot be built using fbcode/mode/opt because executorch's build rules unconditionally pass `-Wno-missing-prototypes` to the compiler. This flag is only valid for C++ in Clang; GCC (used by Zephyr ARM cross-compilation) recognizes it as a C-only flag and rejects it for C++ files when `-Werror` is enabled.

The fix wraps `-Wno-missing-prototypes` in a `select()` that excludes it for Zephyr builds (`ovr_config//os:zephyr`), following the same pattern already used in executorch for Zephyr-specific handling (e.g., ATen header exclusion in `elementwise_util` and `math_util`).

Changes across executorch build files:
- `kernels/portable/op_registration_util.bzl`: Added `os:zephyr` to existing OS select
- `kernels/optimized/op_registration_util.bzl`: Wrapped flags in select
- `kernels/portable/cpu/util/targets.bzl`: Wrapped 8 hardcoded flags in selects
- `kernels/portable/cpu/pattern/targets.bzl`: Wrapped flag in select
- `kernels/aten/cpu/util/targets.bzl`: Added `os:zephyr` to existing OS select
- `codegen/codegen.bzl`: Wrapped flags in `build_portable_lib` and `build_optimized_lib`

Reviewed By: digantdesai

Differential Revision: D100626340
karan1508 added a commit to karan1508/executorch that referenced this pull request Apr 28, 2026
…torch#19071)

Summary:

The zephyr_build target for tsn_graph_simulator cannot be built using fbcode/mode/opt because executorch's build rules unconditionally pass `-Wno-missing-prototypes` to the compiler. This flag is only valid for C++ in Clang; GCC (used by Zephyr ARM cross-compilation) recognizes it as a C-only flag and rejects it for C++ files when `-Werror` is enabled.

The fix wraps `-Wno-missing-prototypes` in a `select()` that excludes it for Zephyr builds (`ovr_config//os:zephyr`), following the same pattern already used in executorch for Zephyr-specific handling (e.g., ATen header exclusion in `elementwise_util` and `math_util`).

Changes across executorch build files:
- `kernels/portable/op_registration_util.bzl`: Added `os:zephyr` to existing OS select
- `kernels/optimized/op_registration_util.bzl`: Wrapped flags in select
- `kernels/portable/cpu/util/targets.bzl`: Wrapped 8 hardcoded flags in selects
- `kernels/portable/cpu/pattern/targets.bzl`: Wrapped flag in select
- `kernels/aten/cpu/util/targets.bzl`: Added `os:zephyr` to existing OS select
- `codegen/codegen.bzl`: Wrapped flags in `build_portable_lib` and `build_optimized_lib`

Reviewed By: digantdesai

Differential Revision: D100626340
Copy link
Copy Markdown
Contributor

@digantdesai digantdesai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@karan1508 karan1508 force-pushed the export-D100626340 branch from eab05c9 to aade9f4 Compare May 6, 2026 12:06
karan1508 added a commit to karan1508/executorch that referenced this pull request May 6, 2026
…torch#19071)

Summary:

The zephyr_build target for tsn_graph_simulator cannot be built using fbcode/mode/opt because executorch's build rules unconditionally pass `-Wno-missing-prototypes` to the compiler. This flag is only valid for C++ in Clang; GCC (used by Zephyr ARM cross-compilation) recognizes it as a C-only flag and rejects it for C++ files when `-Werror` is enabled.

The fix wraps `-Wno-missing-prototypes` in a `select()` that excludes it for Zephyr builds (`ovr_config//os:zephyr`), following the same pattern already used in executorch for Zephyr-specific handling (e.g., ATen header exclusion in `elementwise_util` and `math_util`).

Changes across executorch build files:
- `kernels/portable/op_registration_util.bzl`: Added `os:zephyr` to existing OS select
- `kernels/optimized/op_registration_util.bzl`: Wrapped flags in select
- `kernels/portable/cpu/util/targets.bzl`: Wrapped 8 hardcoded flags in selects
- `kernels/portable/cpu/pattern/targets.bzl`: Wrapped flag in select
- `kernels/aten/cpu/util/targets.bzl`: Added `os:zephyr` to existing OS select
- `codegen/codegen.bzl`: Wrapped flags in `build_portable_lib` and `build_optimized_lib`

Differential Revision: D100626340
karan1508 added a commit to karan1508/executorch that referenced this pull request May 6, 2026
…torch#19071)

Summary:

The zephyr_build target for tsn_graph_simulator cannot be built using fbcode/mode/opt because executorch's build rules unconditionally pass `-Wno-missing-prototypes` to the compiler. This flag is only valid for C++ in Clang; GCC (used by Zephyr ARM cross-compilation) recognizes it as a C-only flag and rejects it for C++ files when `-Werror` is enabled.

The fix wraps `-Wno-missing-prototypes` in a `select()` that excludes it for Zephyr builds (`ovr_config//os:zephyr`), following the same pattern already used in executorch for Zephyr-specific handling (e.g., ATen header exclusion in `elementwise_util` and `math_util`).

Changes across executorch build files:
- `kernels/portable/op_registration_util.bzl`: Added `os:zephyr` to existing OS select
- `kernels/optimized/op_registration_util.bzl`: Wrapped flags in select
- `kernels/portable/cpu/util/targets.bzl`: Wrapped 8 hardcoded flags in selects
- `kernels/portable/cpu/pattern/targets.bzl`: Wrapped flag in select
- `kernels/aten/cpu/util/targets.bzl`: Added `os:zephyr` to existing OS select
- `codegen/codegen.bzl`: Wrapped flags in `build_portable_lib` and `build_optimized_lib`

Differential Revision: D100626340
@karan1508 karan1508 force-pushed the export-D100626340 branch from aade9f4 to ce9fddf Compare May 6, 2026 12:20
karan1508 added a commit to karan1508/executorch that referenced this pull request May 6, 2026
…torch#19071)

Summary:

The zephyr_build target for tsn_graph_simulator cannot be built using fbcode/mode/opt because executorch's build rules unconditionally pass `-Wno-missing-prototypes` to the compiler. This flag is only valid for C++ in Clang; GCC (used by Zephyr ARM cross-compilation) recognizes it as a C-only flag and rejects it for C++ files when `-Werror` is enabled.

The fix wraps `-Wno-missing-prototypes` in a `select()` that excludes it for Zephyr builds (`ovr_config//os:zephyr`), following the same pattern already used in executorch for Zephyr-specific handling (e.g., ATen header exclusion in `elementwise_util` and `math_util`).

Changes across executorch build files:
- `kernels/portable/op_registration_util.bzl`: Added `os:zephyr` to existing OS select
- `kernels/optimized/op_registration_util.bzl`: Wrapped flags in select
- `kernels/portable/cpu/util/targets.bzl`: Wrapped 8 hardcoded flags in selects
- `kernels/portable/cpu/pattern/targets.bzl`: Wrapped flag in select
- `kernels/aten/cpu/util/targets.bzl`: Added `os:zephyr` to existing OS select
- `codegen/codegen.bzl`: Wrapped flags in `build_portable_lib` and `build_optimized_lib`

Differential Revision: D100626340
@karan1508 karan1508 force-pushed the export-D100626340 branch 2 times, most recently from a62ca4e to c085e78 Compare May 6, 2026 20:36
karan1508 added a commit to karan1508/executorch that referenced this pull request May 6, 2026
…torch#19071)

Summary:

The zephyr_build target for tsn_graph_simulator cannot be built using fbcode/mode/opt because executorch's build rules unconditionally pass `-Wno-missing-prototypes` to the compiler. This flag is only valid for C++ in Clang; GCC (used by Zephyr ARM cross-compilation) recognizes it as a C-only flag and rejects it for C++ files when `-Werror` is enabled.

The fix wraps `-Wno-missing-prototypes` in a `select()` that excludes it for Zephyr builds (`ovr_config//os:zephyr`), following the same pattern already used in executorch for Zephyr-specific handling (e.g., ATen header exclusion in `elementwise_util` and `math_util`).

Changes across executorch build files:
- `kernels/portable/op_registration_util.bzl`: Added `os:zephyr` to existing OS select
- `kernels/optimized/op_registration_util.bzl`: Wrapped flags in select
- `kernels/portable/cpu/util/targets.bzl`: Wrapped 8 hardcoded flags in selects
- `kernels/portable/cpu/pattern/targets.bzl`: Wrapped flag in select
- `kernels/aten/cpu/util/targets.bzl`: Added `os:zephyr` to existing OS select
- `codegen/codegen.bzl`: Wrapped flags in `build_portable_lib` and `build_optimized_lib`

Differential Revision: D100626340
@karan1508 karan1508 requested a review from digantdesai May 7, 2026 12:53
Copy link
Copy Markdown
Contributor

@digantdesai digantdesai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review automatically exported from Phabricator review in Meta.

@karan1508 karan1508 force-pushed the export-D100626340 branch from c085e78 to a57a401 Compare May 15, 2026 08:04
karan1508 added a commit to karan1508/executorch that referenced this pull request May 15, 2026
…torch#19071)

Summary:

The zephyr_build target for tsn_graph_simulator cannot be built using fbcode/mode/opt because executorch's build rules unconditionally pass `-Wno-missing-prototypes` to the compiler. This flag is only valid for C++ in Clang; GCC (used by Zephyr ARM cross-compilation) recognizes it as a C-only flag and rejects it for C++ files when `-Werror` is enabled.

The fix wraps `-Wno-missing-prototypes` in a `select()` that excludes it for Zephyr builds (`ovr_config//os:zephyr`), following the same pattern already used in executorch for Zephyr-specific handling (e.g., ATen header exclusion in `elementwise_util` and `math_util`).

Changes across executorch build files:
- `kernels/portable/op_registration_util.bzl`: Added `os:zephyr` to existing OS select
- `kernels/optimized/op_registration_util.bzl`: Wrapped flags in select
- `kernels/portable/cpu/util/targets.bzl`: Wrapped 8 hardcoded flags in selects
- `kernels/portable/cpu/pattern/targets.bzl`: Wrapped flag in select
- `kernels/aten/cpu/util/targets.bzl`: Added `os:zephyr` to existing OS select
- `codegen/codegen.bzl`: Wrapped flags in `build_portable_lib` and `build_optimized_lib`

Reviewed By: digantdesai

Differential Revision: D100626340
…torch#19071)

Summary:

The zephyr_build target for tsn_graph_simulator cannot be built using fbcode/mode/opt because executorch's build rules unconditionally pass `-Wno-missing-prototypes` to the compiler. This flag is only valid for C++ in Clang; GCC (used by Zephyr ARM cross-compilation) recognizes it as a C-only flag and rejects it for C++ files when `-Werror` is enabled.

The fix wraps `-Wno-missing-prototypes` in a `select()` that excludes it for Zephyr builds (`ovr_config//os:zephyr`), following the same pattern already used in executorch for Zephyr-specific handling (e.g., ATen header exclusion in `elementwise_util` and `math_util`).

Changes across executorch build files:
- `kernels/portable/op_registration_util.bzl`: Added `os:zephyr` to existing OS select
- `kernels/optimized/op_registration_util.bzl`: Wrapped flags in select
- `kernels/portable/cpu/util/targets.bzl`: Wrapped 8 hardcoded flags in selects
- `kernels/portable/cpu/pattern/targets.bzl`: Wrapped flag in select
- `kernels/aten/cpu/util/targets.bzl`: Added `os:zephyr` to existing OS select
- `codegen/codegen.bzl`: Wrapped flags in `build_portable_lib` and `build_optimized_lib`

Reviewed By: digantdesai

Differential Revision: D100626340
@karan1508 karan1508 force-pushed the export-D100626340 branch from a57a401 to 56c6a34 Compare May 15, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants